package com.ece.core.config;

import java.util.UUID;

/**
 * Factory to create various ID generating strategies.
 * 
 * @author Senthu Sivasambu, http://ca.linkedin.com/in/sivasambu
 * 
 */
public class IDStrategyFactory {

    private static IDStrategyFactory instance;

    private IDStrategyFactory()
    /* no public instance */
    {

    }

    public static IDStrategyFactory getInstance() {
	if (instance == null) {
	    instance = new IDStrategyFactory();
	}
	return instance;
    }

    public IDStrategy<UUID> createUUIDStrategy() {
	return new IDStrategy<UUID>() {

	    @Override
	    public UUID generateID() {
		return UUID.randomUUID();
	    }
	};
    }

}
